-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
[kotlin] Add integration test for query params #22588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[kotlin] Add integration test for query params #22588
Conversation
This is a test for a regression from OpenAPITools#22512 where param values were written as a list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 3 files
| implementation "com.fasterxml.jackson.module:jackson-module-kotlin:2.20.0" | ||
| implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.20.0" | ||
| implementation "org.springframework.boot:spring-boot-starter-web:$spring_boot_version" | ||
| testImplementation "org.springframework.boot:spring-boot-test:$spring_boot_version" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the PR
i think we will need to update the build.gradle mustache template as well to include this testImlementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I was afraid I was editing in a wrong place, but I could not find a better place for integration tests. I wanted to demonstrate the regression quickly.
I think integration tests (checking what URLs are hit, with what request body string) are very important. With Spring Mock Server, it's easy to write such tests with very little code, and they are also very fast (no port is opened, all happens inside JVM). I would be happy if the integration test suite grows somewhere in the future.
I don't know if integration tests should be part of samples (there are many sample projects, making finding and modifying all integration tests relevant to a feature harder). If you show me a 'cleaner' way to plug in my tests, I am happy to modify my PR.
|
also merged via #22695 (listed you as co-author) with updated build.gradle template and more tests (SHA256) thanks again for adding more tests to ensure more test coverage moving forward |
|
can you please PM me via Slack when you've time? thank you https://join.slack.com/t/openapi-generator/shared_invite/zt-36ucx4ybl-jYrN6euoYn6zxXNZdldoZA |
This is a test for a regression from #22512 where param values were written as a list.
The test passes when the change to ApiClient.kt is reverted. Fails on the regression:
PR checklist
Commit all changed files.
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
master(upcoming7.x.0minor release - breaking changes with fallbacks),8.0.x(breaking changes without fallbacks)"fixes #123"present in the PR description)@karismann @Zomzog @andrewemery @4brunu @yutaka0m @stefankoppier @e5l
I did not run generators because it fails:
Summary by cubic
Adds Kotlin integration tests to verify query parameter encoding in the Spring RestClient and catch the regression from #22512 where values were wrapped as lists. Tests cover PetApi findByStatus (comma-separated list) and UserApi login (single values).
Written for commit 6767688. Summary will update automatically on new commits.